package edu.drawing1;

import java.awt.*;
import javax.swing.JPanel;

public class DrawingArea extends JPanel {
	private Color ovalColor;

	public DrawingArea() {
		ovalColor = Color.GREEN;
		this.setPreferredSize(new Dimension(100, 100));

	}

	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		g.setColor(ovalColor);
		int w = getWidth();
		int h = this.getHeight();
		g.fillOval(0, 0, w, h);
	}
	
	public void setMyColor(Color c)
	{
		ovalColor = c;
		repaint();
	}
}
